var xmlDoc;
var items;

function getNode(TagName, node)
{
	var currentNode = (node == null) ? xmlDoc.getElementsByTagName(TagName) : 
					items[node].getElementsByTagName(TagName);
	if(currentNode.length > 0)
		return currentNode[0].firstChild.nodeValue;
}
function ReadRSS(rssFeed) {

    try 
    {
        if (document.all) 
        {
            var errorHappendHere = "Check Browser and security settings";
            xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        }
        else 
        {
            var errorHappendHere = "Apparently one cant read remote xml via firefox, please copy the file to your server";
            xmlDoc = document.implementation.createDocument("", "", null);
        }

        xmlDoc.async = false;
        xmlDoc.load(rssFeed);
        items = xmlDoc.getElementsByTagName('item');
        return items.length > 0;
    }
    catch (e) 
    {
        return false;
    }
}
var t;
var id=2;
var timer_is_on=0;

function timedBannerCount()
{
	if (id==2)
	{
		document.getElementById('imgBanner').src="imgs/banner_ITnews.png";	
		document.getElementById('imgLink').href="http://blogs.msdn.com/b/itnews/";
		id=1;
	}
	else
	{
		document.getElementById('imgBanner').src="imgs/banner_micopen.png"; 
		document.getElementById('imgLink').href="http://www.microsoft.com/opensource/";
		id=2;
    }

    clearInterval(t);
    t = setTimeout(timedBannerCount, 60000);
}

function doTimer()
{
    if (!timer_is_on)
    {
        id = Math.round(Math.random()) + 1;
        timer_is_on=1;
        timedBannerCount();
    }
}
